package oop.core.med;
import java.util.*;
import oop.core.entity.*;
import oop.core.map.*;

public class WorldCollisionDetection 
{
	private Location avatarLocation;
	private List<Entity> entitiesList;
	
	public WorldCollisionDetection(Location avatarLocation, List<Entity> entitiesList)
	{
		this.avatarLocation = avatarLocation;
		this.entitiesList = entitiesList;
	}
	
	/**
	 * This would get called every clock to check for detection in the real world map
	 * this assumes that the entity list doesn't have avatar
	 */
	public void update()
	{
		Iterator<Entity> iter = entitiesList.iterator();
		while(iter.hasNext())
		{
			Entity entity = iter.next();
			if(entity.getLoc().equals(avatarLocation))
			{
				//Ok, so we need to notify something here
				//to start a battle, pop up a menu, and so on :)
			}
		}
	}
	

}
